package com.cimpm.permission.controller;

import com.cimpm.permission.entity.Organization;
import com.cimpm.permission.service.impl.OrganizationServiceImpl;
import com.hby.common.annotation.Remind;
import com.hby.common.annotation.aspect.AutoEntityProcess;
import com.hby.common.annotation.aspect.NoEntityAutoSingleProcess;
import com.hby.common.annotation.handler.AutoRequestBody;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/organization")
@CrossOrigin
public class OrganizationController {

    @Remind("组织架构")
    @AutoEntityProcess(BUSINESS_CLASS = Organization.class, LOG_MSG = "organization",
            PERMISSION_TYPE = "2345",CUSTOM_EXECUTE = false)
    public Object organizationAuto(@AutoRequestBody Map<String, Object> param){
        return null;
    }

    @RequestMapping("/getUsersHasNoOrganize")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = OrganizationServiceImpl.class,PARAM_FIELD = "",NO_VALID_FIELD = "",LOG_MSG = "getUsersHasNoOrganize",
                MENU_CODE = -1,PERMISSION_TYPE="5",USE_USERINFO = true)
    public Object getUsersHasNoOrganize(@AutoRequestBody Map<String, Object> param){
         return null;
    }

    @RequestMapping("/searchUsersByKey")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = OrganizationServiceImpl.class,PARAM_FIELD = "key",NO_VALID_FIELD = "",LOG_MSG = "searchUsersByKey",
                MENU_CODE = -1,PERMISSION_TYPE="5",USE_USERINFO = true)
    public Object searchUsersByKey(@AutoRequestBody Map<String, Object> param){
         return null;
    }

    @RequestMapping("/getUsersByOrganization")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = OrganizationServiceImpl.class,PARAM_FIELD = "organizationId",NO_VALID_FIELD = "",LOG_MSG = "getUsersByOrganization",
                MENU_CODE = -1,PERMISSION_TYPE="2",USE_USERINFO = true)
    public Object getUsersByOrganization(@AutoRequestBody Map<String, Object> param){
         return null;
    }

    @Remind("为批量操作,userId为数组,且为未分配user，分配过的走Edit接口")
    @RequestMapping("/addOrganization")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = OrganizationServiceImpl.class,PARAM_FIELD = "userIds,organizationId",NO_VALID_FIELD = "",LOG_MSG = "addOrganization",
                MENU_CODE = -1,PERMISSION_TYPE="2",USE_USERINFO = false)
    public Object addOrganization(@AutoRequestBody Map<String, Object> param){
         return null;
    }

    @RequestMapping("/editOrganization")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = OrganizationServiceImpl.class,PARAM_FIELD = "userIds,organizationId",NO_VALID_FIELD = "",LOG_MSG = "editOrganization",
                MENU_CODE = -1,PERMISSION_TYPE="3",USE_USERINFO = false)
    public Object editOrganization(@AutoRequestBody Map<String, Object> param){
         return null;
    }
}
